package member;

import java.io.Reader;
import java.sql.Timestamp;
import java.util.List;
import java.util.ArrayList;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.opensymphony.xwork2.ActionSupport;

import member.Zipcodebean;

public class memberZipcodeAction extends ActionSupport{
	
	public static Reader reader;
	public static SqlMapClient sqlMapper;
	
	private List<Zipcodebean> zipcodeList = new ArrayList<Zipcodebean>();
	private String zipcode;
	private String area1;
	private String area2;
	private String area3;
	private String area4;
	
	private String dong;
	
	public memberZipcodeAction() throws Exception{
		reader = Resources.getResourceAsReader("sqlMapConfig.xml");
		sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
		reader.close();
	}
	
	public String execute() throws Exception{
		
		zipcodeList = sqlMapper.queryForList("Zipcode","%"+getDong()+"%");
		return SUCCESS;
	}
	
	public String getDong() {
		return dong;
	}

	public void setDong(String dong) {
		this.dong = dong;
	}

	public List<Zipcodebean> getZipcodeList() {
		return zipcodeList;
	}

	public void setZipcodeList(List<Zipcodebean> zipcodeList) {
		this.zipcodeList = zipcodeList;
	}

	public String getZipcode() {
		return zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	public String getArea1() {
		return area1;
	}

	public void setArea1(String area1) {
		this.area1 = area1;
	}

	public String getArea2() {
		return area2;
	}

	public void setArea2(String area2) {
		this.area2 = area2;
	}

	public String getArea3() {
		return area3;
	}

	public void setArea3(String area3) {
		this.area3 = area3;
	}

	public String getArea4() {
		return area4;
	}

	public void setArea4(String area4) {
		this.area4 = area4;
	}
}
